<template>

  <div>
    <h1 class="bg-green-500">router</h1>
    <div>
      <!-- replace -->
      <router-link to="/login">login</router-link>
      <router-link to="/reg">reg</router-link>

      <button @click="next">next</button>
      <button @click="prev">prev</button>
    </div>
    <hr>
    <router-view></router-view>
  </div>

</template>

<script setup lang='ts'>
import { ref } from 'vue';
import { useRouter } from 'vue-router';

const router = useRouter();

const next = () => {
  router.go(1);
}
const prev = () => {
  router.back();
}
</script>
<style scoped></style>